import request from '@/utils/request'

export function getEstateList(formData) { // 获取资产列表
    return request({
        method: 'get',
        url: '/properties',
        params:formData
    })
}

// 获取分类列表
export function getCategoryList(data) {
    return request({
        method: 'get',
        url: '/categories',
        data
    })
}
// 新增资产
export function addEstate(data) {
    return request({
        method: 'post',
        url: '/properties',
        data
    })
}

// 获取单个资产信息
export function getEstateInfo(id) {
    return request({
        method: 'get',
        url: `/properties/${id}`
    })
}

// 修改单个资产信息
export function editEstateInfo(data){
    return request({
        method:'put',
        url:`/properties/${data.id}`,
        data
    })
}
//删除资产信息
export function deleteEstate(id){
    return request({
        method:'delete',
        url:`/properties/${id}`
    })
}
// 请求资产总数
export function getEstateNum(data){
    return request({
        method:'get',
        url:`/properties/count`,
        params:data
    })
}

// 获取分类列表
export function getCategoriesList(){
    return request({
        method:'get',
        url:'/categories'
    })
}